/**
 * Copyright (c) 2023 - present All rights reserved.
 * <p>
 * Reprinted has been protected by the copyright laws.
 */

package cn.myxl.smart.devkit.commit.model;

import lombok.Data;

import java.util.Objects;

/**
 * @author zhangyang
 * @date 2023-11-14 14:19
 */

@Data
public class CommitType {
	public String title;
	public String description;

	public CommitType(String title, String description) {
		this.title = title;
		this.description = description;
	}

	@Override
	public boolean equals(Object object) {
		if (this == object) return true;

		if (object == null || getClass() != object.getClass()) return false;

		CommitType commitType = (CommitType) object;

		return Objects.equals(title, commitType.title) && Objects.equals(description, commitType.description);
	}

	@Override
	public int hashCode() {
		return Objects.hash(title, description);
	}

	public String toString() {
		return String.format("%s - %s", this.getTitle(), this.getDescription());
	}
}
